* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 必填字段标记样式 */
.required {
    color: #ff0000;
    margin-left: 3px;
    font-weight: bold;
}

/* 无效输入提示 */
input:invalid, select:invalid {
    border-color: #ff0000;
    background-color: #ffeeee;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: transparent;
    box-shadow: none;
}

/* 原双面板布局 */
.container {
    display: flex;
    gap: 20px;
}

/* 单面板布局 - 用于编辑页 */
.single-panel {
    display: block;
}

.single-panel .edit-section {
    max-width: 800px;
    margin: 0 auto;
}

/* 预览页面容器 */
.preview-container {
    display: block;
    background-color: transparent;
}

.preview-container .preview-section {
    max-width: 800px;
    margin: 0 auto;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
}

h1, h2 {
    margin-bottom: 20px;
    color: #007bff;
}

/* 导航头部 */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.back-btn:hover {
    background-color: #0056b3;
}

/* 表单样式 */
.edit-section {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* 预览区域样式 */
.preview-section {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 健康证样式 - 响应式设计 */
.health-card {    width: 100%;    max-width: 370px;    margin: 40px auto 0;    padding: 6px 4px 6px 6px;    background-color: transparent;    border: 1px solid #000;    box-shadow: none;    line-height: 1.2;    box-sizing: border-box;    position: relative;}

/* 左侧标题居中 */
.left-info h1 {    text-align: left;    padding-left: 35px;    font-size: 18px;    margin: 0 0 8px;    color: #333;    font-weight: bold;    width: 100%;}

.card-content {
    margin-top: 3px;
}

/* 响应式布局 */
.info-section {
    display: flex;
    width: 100%;
    gap: 0;
    position: relative;
}

.left-info {
    flex: 10;
    padding-right: 0;
    padding-left: 5px;
    margin-right: -40px;
    z-index: 1;
    position: relative;
}

.right-info {
    flex: 0 0 auto;
    width: 95px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-left: 0;
    margin-left: -25px;
}

.info-row {
    margin-bottom: 3px;
    display: flex;
}

.info-item {    flex: 1;    font-size: 13px;    line-height: 1.2;}

.long-text {
    width: 100%;
}

.info-item b {
    font-weight: normal;
}

/* 检查机构样式 */
.hospital-row {
    margin-bottom: 1px;
}

.hospital-name {    padding-left: 0;    width: 100%;    line-height: 1.2;    font-size: 12px;}

/* 照片容器 */
.photo-container {    
    width: 90px;    
    height: 120px;    
    border: none;    
    display: flex;    
    align-items: center;    
    justify-content: center;    
    background-color: transparent;    
    margin-bottom: 6px;    
    overflow: hidden;
}

/* 盖章区域容器 */
.stamp-section {
    position: absolute;
    bottom: -5px;
    left: 130px;
    z-index: 10;
}

/* 盖章容器 */
.stamp-container {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 章图片样式 */
#preview-stamp-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.8;
}

/* 二维码容器 */
.qrcode-container {    
    width: 90px;    
    height: 90px;    
    border: none;    
    display: flex;    
    align-items: center;    
    justify-content: center;    
    background-color: transparent;
}

/* 照片预览 */
#preview-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

/* 二维码预览 */
#preview-qrcode-container img, .qrcode-preview img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border: none !important;
}

#preview-qrcode-container canvas, #preview-qrcode-container svg {
    border: none !important;
}

/* 编辑页面二维码预览 */
.qrcode-preview {
    width: 120px;
    height: 120px;
    border: none;
    margin-top: 5px;
    background-color: transparent;
    display: block;
    padding: 5px;
    overflow: hidden;
    position: relative;
}

/* 按钮位置调整 */
.actions {    display: flex;    gap: 10px;    justify-content: center;    max-width: 370px;    position: fixed;    bottom: 20px;    left: 0;    right: 0;    margin: 0 auto;    z-index: 100;}

/* 重新生成按钮样式 */
.regenerate-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    text-decoration: none;
}

.regenerate-btn:hover {
    background-color: #0056b3;
}

/* 健康证重新生成动画 */
@keyframes regenerating {
    0% { opacity: 0.7; }
    50% { opacity: 0.5; }
    100% { opacity: 0.7; }
}

.regenerating {
    animation: regenerating 1.2s infinite;
    pointer-events: none; /* 动画期间禁止交互 */
}

/* 已将移动设备样式应用到所有设备 */

/* 打印样式 */
@media print {
    body * {
        visibility: hidden;
    }
    .health-card, .health-card * {
        visibility: visible;
    }
    .health-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: 1px solid #000;
    }
    .stamp-container, .stamp-container img {
        z-index: 10;
        visibility: visible;
    }
    .actions, .system-title {
        display: none;
    }
}

/* 保存消息提示样式 */
.save-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

.save-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.save-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 系统标题样式 */
.system-title {
    background-color: #007bff;
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0 0 20px 0;
    border-radius: 0;
}

.system-title h1 {
    margin: 0;
    font-size: 18px;
    color: white;
    letter-spacing: 2px;
}

/* 查询区域样式 */
.query-section {
    margin-top: 30px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.query-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.query-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.query-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.query-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 管理健康证按钮样式 */
.manage-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}

.manage-btn:hover {
    background-color: #218838;
}

/* 查看所有健康证按钮样式 */
.manage-link {
    margin-top: 15px;
    text-align: right;
}

.view-all-btn {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.view-all-btn:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* 查询所有健康证按钮样式 */
.query-all-btn {
    display: inline-block;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s;
}

.query-all-btn:hover {
    background-color: #218838;
}

/* 页面内消息提示容器 */
#messageContainer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 80%;
    max-width: 400px;
}

/* 页面内消息提示 */
.page-message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: opacity 0.3s;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}